package com.ykq.core.handler;

import com.ykq.core.vo.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: 闫克起
 * @Description:
 * @Date: Create in 9:02 2024/8/14
 */
@RestControllerAdvice  //处理controller层的异常
public class MyGlobalHandler {

    @ExceptionHandler(Exception.class)
    public R error(Exception e){
        e.printStackTrace();
        return R.error(e.getMessage());
    }
}
